package com.example.film.controller;

import com.example.film.entity.FilmHot;
import com.example.film.service.FilmHotService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "热点资讯信息管理接口")
@CrossOrigin
@RestController
@RequestMapping("filmHot/v1")
public class FilmHotController {
    @Autowired
    private FilmHotService filmHotService;

    @ApiOperation("热点资讯信息")
    @GetMapping("/hotMessage")
    public List<FilmHot> getFilmHot(){
        return filmHotService.findFilmHot();
    }

    @ApiOperation("分页查询热点资讯信息")
    @GetMapping("/hotInfo")
    public List<FilmHot> getFilmHotInfo(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize){
        return filmHotService.findFilmHotInfo(pageNum, pageSize);
    }
}
